import time

import pytz
from datetime import datetime, timedelta, timezone


# china_zone = timezone(timedelta(hours=8))
# ruidian_zone = timezone(timedelta(hours=1))
# utc_zone = timezone(timedelta(hours=0))

# tzinfo = pytz.timezone('utc')
# now = datetime.now(tz=china_zone)
# now1 = datetime.now().replace(tzinfo=tzinfo)
# now2 = datetime.now().astimezone(tz=utc_zone)
# print(now)
# print(now1)
# print(now2)
# print(now1 - now)


# from dateutil.parser import parse
#
# first_time = '2018.02.02T12:12:12'
# date_time = parse(first_time)
#
# a = date_time.strftime('%Y-%m-%dT%H:%M:%S')
# print(a)
# print(parse(a), type(parse(a)))
# end_time = parse('2018.02.02T12:12:13')
# print(date_time)

# print([i for i in dir(date_time.astimezone(tz=None)) if '__' not in i])
# un_time = time.mktime(date_time.timetuple())
# u_time = time.mktime(end_time.timetuple())
# print(un_time)
# print(u_time)
# print(f'---------{u_time - un_time}')
# print(un_time, type(un_time))
# times = datetime.fromtimestamp(un_time)
# print(times, type(times))


# from dateutil import rrule
# rrule.rrule(rrule.SECONDLY)




# import datetime
#
# date1 = datetime.date(2019, 12, 12)
# print(datetime.date.today())
# datetime1= datetime.datetime(2019, 12, 12, 12, 5)
# print(date1, type(date1))
# print(datetime1, type(datetime1))
#
# print(datetime1.date())
# print(datetime1.day, datetime1.year, datetime1.month, datetime1.second, datetime1.hour, datetime1.minute)


import datetime
import pytz


tzinfo = pytz.timezone('utc')
now = datetime.datetime.now(tz=tzinfo)
print(now)
print(datetime.datetime.now())


# django 时区问题
# https://www.cnblogs.com/xuecaichang/p/10403042.html


# https://www.jianshu.com/p/f29dddce3a9a  时间解析/datetime格式


